﻿namespace TI_BLE_HCI_ClientLib.HCIBaseEntities
{
    public enum HCICommandOGF
    {
        LinkControlCommands = 1,
        LinkPolicyCOmmands = 2,
        ControllerAndBasebandCommands = 3,
        InformationalParameters = 4,
        StatusParameters = 5,
        TestingCommands = 6,
        LEOnlyCommands = 8,
        VendorSpecificCommands = 63
    }

    public enum HCIVendorSpecificCommandCSG
    {
        HCI = 0,
        L2CAP = 1,
        ATT = 2,
        GATT = 3,
        GAP = 4,
        UTIL = 5,
        Reserved = 6,
        UserProfile = 7
    }

    public enum HCIVendorSpecificCommandOpcode
    {
        HCIEXT_SystemReset=(HCICommandOGF.VendorSpecificCommands<< 10) + (HCIVendorSpecificCommandCSG.HCI<< 7) + 29,
        GAP_Device_Init = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GAP << 7) + 0,
        GAP_Device_Discovery_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GAP << 7) + 4,
        GAP_Device_Discovery_Cancel = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GAP << 7) + 5,
        GAP_Establish_Link_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GAP << 7) + 9,
        GAP_Terminate_Link_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GAP << 7) + 10,
        GAP_Make_Discoverable = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificEventESG.GAP << 7) + 6,
        GAP_End_Discoverable = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificEventESG.GAP << 7) + 8,
        GAP_Update_Advertising_Data = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificEventESG.GAP << 7) + 7,
        GAP_Set_Parameter = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificEventESG.GAP << 7) + 48,

        ATT_Error_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 1,
        ATT_Exchange_MTU_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 2,
        ATT_Exchange_MTU_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 3,
        ATT_Discover_Characteristics_by_UUID = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 8,
        ATT_Read_Characteristic_Value_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 10,
        ATT_Write_Characteristic_Value_Request = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 18,
        ATT_Read_Characteristic_Value_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 11,
        ATT_Write_Characteristic_Value_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 19,
        ATT_Read_By_Group_Type_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 17,
        ATT_Find_By_Type_Value_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 7,
        ATT_Add_Service = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 252,
        ATT_Add_Attribute = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 254,
        ATT_Read_By_Type_Response = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 9,
        ATT_Handle_Value_Notification = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 27,
        ATT_Handle_Value_Indication_Confirmation = (HCICommandOGF.VendorSpecificCommands << 10) + (HCIVendorSpecificCommandCSG.GATT << 7) + 30
    }
}